package com.weibo.util;

import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import com.weibo.service.WeiboService;

public class WeiboPingceTimerTask extends TimerTask{

	 //定义组件  
    private Timer timer;  
    
    public  WeiboPingceTimerTask(){  
   	 //Get the Date corresponding to 11:01:00 pm today.
   	Calendar calendar = Calendar.getInstance();
   	calendar.set(Calendar.HOUR_OF_DAY,02);
   	calendar.set(Calendar.MINUTE, 37);
   	calendar.set(Calendar.SECOND, 00);
   	Date time = calendar.getTime();

   	timer = new Timer();
   	timer.schedule(this, time);

    }  
    
    public void run() {  
    	System.out.println("微博采集任务开始执行： "+new Date());  
    	WeiboService ws = new WeiboService();
    	ws.saomiaoPingce();
    }  
    
    
    
    public static void main(String[] args) {  
        new WeiboPingceTimerTask();  
    }  

}
